<template>
  <div class="second" id="top">
    <div class="secondtop">
      <div class="left" @click="fnh1">
        <input
          type="text"
          class="tianjiacaipu"
          ref="mytitle1"
          v-model="title"
        />
        <h1 class="h1text" ref="myhitext">添加菜谱名称</h1>
      </div>
      <div class="right">
        <a href="#" class="caogao">
          <span>草稿箱</span>
        </a>
        <a href="#" class="shanchu">
          <span>删除草稿</span>
        </a>
      </div>
    </div>
    <!-- 菜谱封面 -->
    <Hxssecondfengmian
      v-model="filessend"
      :value.sync="msng"
    ></Hxssecondfengmian>
    <!-- 头像与头像名 -->
    <Hxssectouxiang :value.sync="miaoshutext"></Hxssectouxiang>

    <!-- 回到顶部懒加载-->
    <div class="dingbu">
      <a href="#top">
        <span class="dingbupicture">
          <img src="https://s.chuimg.com/pic/2013/scroll_top.png" ref="myref" />
        </span>
      </a>
    </div>

    <!-- 表格循环-->
    <div class="yongliao">用料</div>
    <div>
      <div class="tablee">
        <input
          type="text"
          class="inputleft"
          placeholder="食材：如鸡蛋"
          v-model="biapyi1"
        />
        <input type="text" placeholder="用量：如1只" v-model="biapyi2" />
        <span>
          <img src="https://s.chuimg.com/pic/drag.png" />
        </span>
        <span>
          <img src="https://s.chuimg.com/pic/close.png" />
        </span>
      </div>
      <div class="tablee">
        <input
          type="text"
          class="inputleft"
          placeholder="食材：如鸡蛋"
          v-model="biapyi3"
        />
        <input type="text" placeholder="用量：如1只" v-model="biapyi4" />
        <span>
          <img src="https://s.chuimg.com/pic/drag.png" />
        </span>
        <span>
          <img src="https://s.chuimg.com/pic/close.png" />
        </span>
      </div>
      <div class="tablee">
        <input
          type="text"
          class="inputleft"
          placeholder="食材：如鸡蛋"
          v-model="biapyi5"
        />
        <input type="text" placeholder="用量：如1只" v-model="biapyi6" />
        <span>
          <img src="https://s.chuimg.com/pic/drag.png" />
        </span>
        <span>
          <img src="https://s.chuimg.com/pic/close.png" />
        </span>
      </div>
      <div class="tablee">
        <input
          type="text"
          class="inputleft"
          placeholder="食材：如鸡蛋"
          v-model="biapyi7"
        />
        <input type="text" placeholder="用量：如1只" v-model="biapyi8" />
        <span>
          <img src="https://s.chuimg.com/pic/drag.png" />
        </span>
        <span>
          <img src="https://s.chuimg.com/pic/close.png" />
        </span>
      </div>

      <div class="flex1">
        <span class="addyongliao">追加一行用料</span>
        <span class="fenzutihsi">用料以#开头可以分组</span>
      </div>
    </div>
    <!-- 做法 -->
    <Hxssezuofa
      :value.sync="zuofa1"
      :value1.sync="zuofa2"
      :value2.sync="zuofa3"
      :value3.sync="zuofa4"
      :value4.sync="zuofa5"
      v-model="filesend1"
      :value11.sync="filesend2"
      :value22.sync="filesend3"
      :value33.sync="filesend4"
      :value44.sync="filesend5"
    ></Hxssezuofa>
    <!-- 发送菜谱 -->
    <Hxssefasong
      :title1="title"
      :filessend2="filessend"
      :msng="msng"
      :miaoshutext="miaoshutext"
      :zuofa1="zuofa1"
      :zuofa2="zuofa2"
      :zuofa3="zuofa3"
      :zuofa4="zuofa4"
      :zuofa5="zuofa5"
      :filesend1="filesend1"
      :filesend2="filesend2"
      :filesend3="filesend3"
      :filesend4="filesend4"
      :filesend5="filesend5"
      :biapyi1="biapyi1"
      :biapyi2="biapyi2"
      :biapyi3="biapyi3"
      :biapyi4="biapyi4"
      :biapyi5="biapyi5"
      :biapyi6="biapyi6"
      :biapyi7="biapyi7"
      :biapyi8="biapyi8"

    ></Hxssefasong>
  </div>
</template>

<script>
import Hxssecondfengmian from "./Hxssecondfengmian.vue";
import Hxssectouxiang from "./Hxssectouxiang.vue";
import Hxssezuofa from "./Hxssezuofa.vue";
import Hxssefasong from "./Hxssefasong.vue";

export default {
  data() {
    return {
      title: "",
      filessend: "",
      msng: "",
      miaoshutext: "",
      zuofa1: "",
      zuofa2: "",
      zuofa3: "",
      zuofa4: "",
      zuofa5: "",
      filesend1: "",
      filesend2: "",
      filesend3: "",
      filesend4: "",
      filesend5: "",
      biapyi1: "",
      biapyi2: "",
      biapyi3: "",
      biapyi4: "",
      biapyi5: "",
      biapyi6: "",
      biapyi7: "",
      biapyi8: "",
    };
  },
  methods: {
    // 锚点定位懒加载
    fn() {
      // console.log(9999, window.pageYOffset);
      if (window.pageYOffset >= 400) {
        // console.log(this.$refs);
        this.$refs.myref.style.display = "block";
        // console.log(dingbupicture);
      } else {
        this.$refs.myref.style.display = "none";
      }
    },
    fnh1() {
      this.$refs.myhitext.style.display = "none";
    },

    // register(){
    //   window.console.log((this.title))
    // }
  },
  created() {
    window.onscroll = () => {
      this.fn();
    };
  },
  //  mounted(){

  //     // this.title=this.$refs.mytitle1.value

  //   },
  components: {
    Hxssecondfengmian,
    Hxssectouxiang,
    Hxssezuofa,
    Hxssefasong,
  },
};
</script>


<style lang="scss" scoped>
.second {
  width: 1000px;
  height: 3220px;
  margin: 0 auto;
  margin-top: 85px;
}

.secondtop {
  width: 100%;
  height: 70px;
  margin: 0 auto;
  // background-color: wheat;
  display: flex;
  justify-content: space-between;
}
.left {
  width: 660px;
  height: 100%;
  position: relative;
  // background-color: rgb(240, 231, 216);
}
.tianjiacaipu {
  width: 100%;
  height: 100%;
  background-color: rgb(240, 231, 216);
  border: none;
}
.h1text {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}
.right {
  width: 30%;
  height: 100%;
  // background-color: violet;
}
.h1text {
  color: #888888;
  font-weight: bolder;
  line-height: 70px;
  margin-left: 14px;
}
.caogao span {
  display: inline-block;
  width: 80px;
  height: 100%;
  color: red;
  font-size: 16px;
  // background-color: rosybrown;
  line-height: 70px;
  text-align: center;
}
.shanchu span {
  display: inline-block;
  width: 80px;
  height: 100%;
  font-size: 16px;
  text-align: center;
  color: #909090;
}
.dingbupicture img {
  width: 60px;
  height: 60px;
  position: fixed;
  right: 20px;
  bottom: 80px;
  display: none;
}
.yongliao {
  width: 300px;
  height: 40px;
  font-size: 29px;
  font-weight: bolder;
  line-height: 40px;
  margin-top: 12px;
  padding-left: 12px;
  margin-bottom: 22px;
  color: #c0ae81;
}
.tablee input {
  width: 330px;
  height: 40px;
}
.tablee input:hover {
  background-color: blanchedalmond;
  color: #909090;
}
.addyongliao {
  display: inline-block;
  width: 140px;
  height: 40px;
  text-align: center;
  color: white;
  margin-top: 8px;
  line-height: 40px;
  background-color: #c5bfb6;
  border: 1px solid gray;
}
.fenzutihsi {
  width: 140px;
  height: 40px;
  text-align: center;
  margin-top: 8px;
  line-height: 40px;
  color: #9e909e;
}
.addyongliao:hover {
  background-color: rgb(41, 19, 19);
  color: white;
}
.tablee span {
  display: inline-block;
  width: 40px;
  margin-left: 14px;
  // height: 40px;
}
// .inputleft{
//   border-right: 0;
//   border-bottom: 0;
// }
.flex1 {
  display: flex;
  width: 680px;
  justify-content: space-between;
  margin-top: 13px;
}
</style>
